//-----------------------------------------------------------------------
// <copyright file="LienHeServiceBase.cs" company="Pyramid Consulting">
//     Copyright (c) Pyramid Consulting. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------	

using System;
using System.Collections;
using Pyco;
using Pyco.Diagnostics;
using Pyco.Data;
using APPro.Entities;
using APPro.Data;
    
namespace APPro.Business
{   
	/// <summary>
	/// 
	/// </summary> 
    public class LienHeServiceBase
    {
        #region LienHeServiceBase

        public static void CreateLienHe(LienHe lienHe)
        {            
            try
            {
                LienHeDAO lienHeDAO = new LienHeDAO();
                lienHeDAO.CreateLienHe(lienHe);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SRBase.BusinessCreateLienHeException, ex);
            }
        }

        public static void UpdateLienHe(LienHe lienHe)
        {            
            try
            {
                LienHeDAO lienHeDAO = new LienHeDAO();
                lienHeDAO.UpdateLienHe(lienHe);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SRBase.BusinessUpdateLienHeException, ex);
            }
        }        

        public static void DeleteLienHe(string email)
        {            
            try
            {
                LienHeDAO lienHeDAO = new LienHeDAO();
                lienHeDAO.DeleteLienHe(email);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SRBase.BusinessDeleteLienHeException, ex);
            }
        }
		
        public static LienHe GetLienHe(string email)
        {            
            try
            {
                LienHeDAO lienHeDAO = new LienHeDAO();
                return lienHeDAO.GetLienHe(email);                
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SRBase.BusinessGetLienHeException, ex);
            }
        }                
		
        public static LienHeCollection GetLienHeList(LienHeColumns orderBy, OrderDirection orderDirection)
        {            
            try
            {
                LienHeDAO lienHeDAO = new LienHeDAO();
                return lienHeDAO.GetLienHeList(orderBy, orderDirection);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SRBase.BusinessGetLienHeListException, ex);
            }
        }        

        public static LienHeCollection GetLienHeList(LienHeColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {            
            try
            {
                LienHeDAO lienHeDAO = new LienHeDAO();
                return lienHeDAO.GetLienHeList(orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SRBase.BusinessGetLienHeListException, ex);
            }
        }        
		
		
        #endregion
    }
}